---
layout: default
title: 按类别查找博客
---

<div class="categories">
{% assign category_list = site.categories %}
  {% if category_list.first[0] == null %}
    {% for category in category_list %}
        <a class="categoriesa" href="#{{ category | slugify }}">{{ category }}</a>
    {% endfor %}
  {% else %}
    {% for category in category_list %}
        <a class="categoriesa" href="#{{ category[0] | slugify }}">{{ category[0] }}</a>
    {% endfor %}
  {% endif %}
{% assign category_list = nil %}
</div>

{% for category in site.categories  %}
    <span class="categorytitle" id="{{ category[0] | slugify }}">{{ category[0] }}</span>
    <ul class="post-list">
        {% assign pages_list = category[1] %}
        {% for post in pages_list reversed %}
            {% if post.title != null %}
            {% if group == null or group == post.group %}
            <li><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>
            {% endif %}
            {% endif %}
        {% endfor %}
        {% assign pages_list = nil %}
        {% assign group = nil %}
    </ul>
{% endfor %}
